package vue;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JMenuBar;
import javax.swing.JButton;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.JList;
import javax.swing.JScrollPane;
import javax.swing.AbstractListModel;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import java.awt.FlowLayout;
import javax.swing.JTextArea;
import javax.swing.border.SoftBevelBorder;
import javax.swing.border.BevelBorder;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class ModifierParcours extends JFrame {

	private JPanel contentPane;
	private JTextField textField;
	private JTable table;
	private JTable table_1;

	/**
	 * Launch the application.
	 */
	/*public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					ModifierParcours frame = new ModifierParcours();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}*/
	public void close()
	{
		this.dispose();
	}
	public void refreshPage()
	{
		this.repaint();
	}
	/**
	 * Create the frame.
	 */
	public ModifierParcours() {
		setTitle("Modifier Parcours");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 857, 669);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setBounds(0, 0, 258, 31);
		contentPane.add(panel);
		panel.setLayout(null);
		
		JMenuBar menuBar = new JMenuBar();
		menuBar.setBounds(0, 0, 233, 33);
		panel.add(menuBar);
		
		JButton btnNewButton = new JButton("Accueil");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				Accueil accueilVue = new Accueil();
				accueilVue.setVisible(true);
				close();
			}
		});
		menuBar.add(btnNewButton);
		
		JButton btnNewButton_2 = new JButton("Consulter");
		btnNewButton_2.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				Consulter consulterVue = new Consulter();
				consulterVue.setVisible(true);
				close();
			}
		});
		menuBar.add(btnNewButton_2);
		
		JButton btnNewButton_1 = new JButton("Editer");
		btnNewButton_1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				Editer editerVue = new Editer();
				editerVue.setVisible(true);
				close();
			}
		});
		menuBar.add(btnNewButton_1);
		
		JLabel lblModifierParcours = new JLabel("Modifier Parcours");
		lblModifierParcours.setFont(new Font("Tahoma", Font.PLAIN, 18));
		lblModifierParcours.setBounds(328, 57, 168, 31);
		contentPane.add(lblModifierParcours);
		
		JPanel panel_1 = new JPanel();
		panel_1.setBounds(63, 108, 320, 448);
		contentPane.add(panel_1);
		panel_1.setLayout(null);
		
		JLabel lblLibelle = new JLabel("Libelle : ");
		lblLibelle.setBounds(10, 11, 61, 14);
		panel_1.add(lblLibelle);
		
		textField = new JTextField();
		textField.setBounds(97, 8, 108, 20);
		panel_1.add(textField);
		textField.setColumns(10);
		
		JLabel lblLieu = new JLabel("Lieu : ");
		lblLieu.setBounds(10, 84, 46, 14);
		panel_1.add(lblLieu);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(97, 82, 108, 20);
		panel_1.add(scrollPane);
		
		JList list = new JList();
		scrollPane.setViewportView(list);
		list.setModel(new AbstractListModel() {
			String[] values = new String[] {};
			public int getSize() {
				return values.length;
			}
			public Object getElementAt(int index) {
				return values[index];
			}
		});
		
		JLabel lblCategorie = new JLabel("Categorie :");
		lblCategorie.setBounds(10, 48, 72, 14);
		panel_1.add(lblCategorie);
		
		JScrollPane scrollPane_1 = new JScrollPane();
		scrollPane_1.setBounds(97, 47, 108, 20);
		panel_1.add(scrollPane_1);
		
		JList list_1 = new JList();
		scrollPane_1.setViewportView(list_1);
		list_1.setModel(new AbstractListModel() {
			String[] values = new String[] {};
			public int getSize() {
				return values.length;
			}
			public Object getElementAt(int index) {
				return values[index];
			}
		});
		
		JLabel lblPointDintert = new JLabel("Point d'inter\u00EAt : ");
		lblPointDintert.setBounds(10, 127, 96, 20);
		panel_1.add(lblPointDintert);
		
		JButton btnAjouter = new JButton("Ajouter");
		btnAjouter.setBounds(156, 126, 89, 23);
		panel_1.add(btnAjouter);
		
		JPanel panel_2 = new JPanel();
		panel_2.setBounds(10, 158, 300, 279);
		panel_1.add(panel_2);
		panel_2.setLayout(null);
		
		JScrollPane scrollPane_2 = new JScrollPane();
		scrollPane_2.setBounds(0, 11, 280, 257);
		panel_2.add(scrollPane_2);
		
		table = new JTable();
		scrollPane_2.setViewportView(table);
		table.setModel(new DefaultTableModel(
			new Object[][] {
			},
			new String[] {
				"Point d'inter\u00EAt", "Supprimer"
			}
		) {
			boolean[] columnEditables = new boolean[] {
				false, false
			};
			public boolean isCellEditable(int row, int column) {
				return columnEditables[column];
			}
		});
		
		JPanel panel_3 = new JPanel();
		panel_3.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
		panel_3.setBounds(502, 108, 329, 448);
		contentPane.add(panel_3);
		panel_3.setLayout(null);
		
		JLabel lblDescriptif = new JLabel("Descriptif : ");
		lblDescriptif.setBounds(10, 11, 80, 14);
		panel_3.add(lblDescriptif);
		
		JTextArea textArea = new JTextArea();
		textArea.setBounds(10, 31, 309, 153);
		panel_3.add(textArea);
		
		JLabel lblPointDintertDu = new JLabel("Point d'inter\u00EAt du parcours : ");
		lblPointDintertDu.setBounds(20, 211, 178, 14);
		panel_3.add(lblPointDintertDu);
		
		JButton btnValider = new JButton("Valider");
		btnValider.setBounds(133, 414, 89, 23);
		panel_3.add(btnValider);
		
		JPanel panel_4 = new JPanel();
		panel_4.setBounds(20, 237, 299, 162);
		panel_3.add(panel_4);
		panel_4.setLayout(null);
		
		JScrollPane scrollPane_3 = new JScrollPane();
		scrollPane_3.setBounds(0, 0, 299, 162);
		panel_4.add(scrollPane_3);
		
		table_1 = new JTable();
		scrollPane_3.setViewportView(table_1);
		table_1.setModel(new DefaultTableModel(
			new Object[][] {
			},
			new String[] {
				"Point d'inter\u00EAt", "Supprimer"
			}
		) {
			boolean[] columnEditables = new boolean[] {
				false, false
			};
			public boolean isCellEditable(int row, int column) {
				return columnEditables[column];
			}
		});
		
		JButton btnTerminer = new JButton("Terminer");
		btnTerminer.setBounds(381, 597, 89, 23);
		contentPane.add(btnTerminer);
	}
}
